package css.databaseBL;

import java.rmi.RemoteException;

import css.databaseBLService.DatabaseFactory;
import css.databaseBLService.DatabaseService;
import css.po.UserPO;
import css.po.student.StudentPO;

public class DatabaseFactory_Stub implements DatabaseFactory{
	public static DatabaseService<UserPO> userDatabase;
	public static DatabaseService<StudentPO> studentDatabase;
	public DatabaseFactory_Stub() {
		this.userDatabase = new DatabaseServiceImpl_Stub();
		this.studentDatabase = new DatabaseServiceImpl_Stub();
	}
	public DatabaseService<UserPO> getUserDatabase() throws RemoteException {
		if(userDatabase == null) {
			userDatabase = (DatabaseService<UserPO>) new DatabaseFactory_Stub();	
		}
		return userDatabase;
	}

	@Override
	public DatabaseService<StudentPO> getStudentDatabase()
			throws RemoteException {
		// TODO Auto-generated method stub
		if(studentDatabase == null) {
			studentDatabase = (DatabaseService<StudentPO>) new DatabaseFactory_Stub();
		}
		return studentDatabase;
	}

}
